package {
	import idv.cjcat.pyronova.nodes.Circle;
	import idv.cjcat.pyronova.nodes.FillRect;
	import idv.cjcat.pyronova.nodes.Group;
	import idv.cjcat.pyronova.nodes.LineSegments;
	import idv.cjcat.pyronova.nodes.Node;
	
	public class Main extends PyronovaExample {
		
		private var group:Group;
		
		public function Main():void {
			super("Crosshair");
		}
		
		override protected function buildPreprocessor():Node {
			//clean buffer
			return new FillRect(view.bitmapData().rect, 0xFF202020);
		}
		
		override protected function buildRoot():Node {
			group = new Group(
				new LineSegments(
					Vector.<Number>([-30, 30, 30, -30, -30, -30, 30, 30]), 
					Vector.<uint>([0xFF0000, 0x00FF00]), 
					false
				), 
				new Circle(
					0, 0, 20, 
					0xFFFF00, false
				)
			);
			group.position.set(160, 100);
			
			return group;
		}
		
		override protected function mainLoop():void {
			group.rotation += 2;
		}
	}
}